package com.zoe.vhr.model;

import cn.hutool.core.collection.CollUtil;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

public class Department implements Serializable {
    private static final long serialVersionUID = -1L;
    private Integer id;

    @Size(min = 3, max = 11, message = "部门名称最小长度3,最大长度11")
    private String name;

    private Integer parentid;

    private String deppath;

    private Boolean enabled;

    private Boolean isparent;

    private List<Department> children = CollUtil.newArrayList();

    private Integer result;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getParentid() {
        return parentid;
    }

    public void setParentid(Integer parentid) {
        this.parentid = parentid;
    }

    public String getDeppath() {
        return deppath;
    }

    public void setDeppath(String deppath) {
        this.deppath = deppath == null ? null : deppath.trim();
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Boolean getIsparent() {
        return isparent;
    }

    public void setIsparent(Boolean isparent) {
        this.isparent = isparent;
    }

    public List<Department> getChildren() {
        return children;
    }

    public void setChildren(List<Department> children) {
        this.children = children;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "Department{" +
            "id=" + id +
            ", name='" + name + '\'' +
            ", parentid=" + parentid +
            ", deppath='" + deppath + '\'' +
            ", enabled=" + enabled +
            ", isparent=" + isparent +
            ", children=" + children +
            ", result=" + result +
            '}';
    }
}